package TutorielChevalier;


import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class TestSorcier.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class TestSorcier
{
    /**
     * Default constructor for test class TestSorcier
     */
    public TestSorcier()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void testSoigner()
    {
        Chevalier Lancelot = new Chevalier();
        Sorcier ObiwanKenobi = new Sorcier();
        Lancelot.setVie(100);
        ObiwanKenobi.addChevalier(Lancelot);
        ObiwanKenobi.soigner();
        assertEquals(110, Lancelot.getVie());
        Chevalier KimJongUn = new Chevalier();
        KimJongUn.setVie(100);
        ObiwanKenobi.addChevalier(KimJongUn);
        ObiwanKenobi.soigner();
        assertEquals(120, Lancelot.getVie());
        assertEquals(110, KimJongUn.getVie());
    }
    
    @Test
    public void testListSize()
    {
        Chevalier Lancelot = new Chevalier();
        Sorcier ObiwanKenobi = new Sorcier();
        ObiwanKenobi.addChevalier(Lancelot);
        Chevalier KimJongUn = new Chevalier();
        ObiwanKenobi.addChevalier(KimJongUn);
        assertEquals(2, ObiwanKenobi.getChevaliers().size());
    }
}

